@extends('webadmin.index')

@section('title','订单列表')

@section('content')

<style>
	#pages li{
		float: left;
	    height: 20px;
	    padding: 0 10px;
	    display: block;
	    font-size: 12px;
	    line-height: 20px;
	    text-align: center;
	    cursor: pointer;
	    outline: none;
	    background-color: #444444;
	    color: #fff;
	    text-decoration: none;
	    border-right: 1px solid #232323;
	    border-left: 1px solid #666666;
	    border-right: 1px solid rgba(0, 0, 0, 0.5);
	    border-left: 1px solid rgba(255, 255, 255, 0.15);
	    -webkit-box-shadow: 0px 1px 0px rgba(0, 0, 0, 0.5), inset 0px 1px 0px rgba(255, 255, 255, 0.15);
	    -moz-box-shadow: 0px 1px 0px rgba(0, 0, 0, 0.5), inset 0px 1px 0px rgba(255, 255, 255, 0.15);
	    box-shadow: 0px 1px 0px rgba(0, 0, 0, 0.5), inset 0px 1px 0px rgba(255, 255, 255, 0.15);
	}
	#pages .active{
		background-color:#c5d52b;
	}
	#pages .active span{
		color:black;
	}
	#pages {
		height:auto;
		overflow:hidden;
		margin:0px;
		padding:0px;
	}
	.pagination{
		padding:0px;
		margin:0px;
	}
</style>

<div class="mws-panel grid_8">
	<div class="mws-panel-header">
    	<span><i class="icon-table"></i>订单列表</span>
    </div>
    <div class="mws-panel-body no-padding">
        <div id="DataTables_Table_0_wrapper" class="dataTables_wrapper" role="grid">
        <form action="/admin/order">
        	<div id="DataTables_Table_0_length" class="dataTables_length">
        		<label>显示 
        			<select size="1" name="num" aria-controls="DataTables_Table_0">
						<option value="5" @if(!empty($data['num']) && $data['num'] == 5) selected @endif>5</option>
						<option value="10" @if(!empty($data['num']) && $data['num'] == 10) selected @endif>10</option>
						<option value="50" @if(!empty($data['num']) && $data['num'] == 50) selected @endif>50</option>
						<option value="100" @if(!empty($data['num']) && $data['num'] == 100) selected @endif>100</option>
				</select> 条</label>
        	</div>
        	<div class="dataTables_filter" id="DataTables_Table_0_filter">
        		<label>关键字: 
        			<input type="text" value="{{$data['keywords'] or ''}}" name="keywords" aria-controls="DataTables_Table_0"><button class="btn btn-primary" type="submit">搜索</button>
        		</label>
        	</div>
		</form>
        	<table class="mws-datatable mws-table dataTable" id="DataTables_Table_0" aria-describedby="DataTables_Table_0_info">
            <thead>
                <tr role="row">
                	<th class="sorting_asc" role="columnheader" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" aria-sort="ascending" aria-label="Rendering engine: activate to sort column descending" style="width: 156px;">ID</th>
                	<th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" aria-label="Browser: activate to sort column ascending" style="width: 208px;">订单号</th>
                	<th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" aria-label="Engine version: activate to sort column ascending" style="width: 136px;">订单状态</th>
                	<th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" aria-label="CSS grade: activate to sort column ascending" style="width: 101px;">发货时间</th>
                	<th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" aria-label="CSS grade: activate to sort column ascending" style="width: 101px;">订单金额</th>
                	<th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" aria-label="CSS grade: activate to sort column ascending" style="width: 101px;">支付方式</th>
                	<th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" aria-label="CSS grade: activate to sort column ascending" style="width: 101px;">操作</th>
                </tr>
            </thead>
            
        <tbody role="alert" aria-live="polite" aria-relevant="all">
        		@foreach($orders as $k=>$v)
        		<tr class="@if($k % 2 == 0) even @else odd @endif">
                    <td class=" sorting_1">{{$v->id}}</td>
                    <td class=" ">{{$v->onum}}</td>
                    <td class=" ">{{$v->oStatus}}</td>
                    <td class=" ">{{$v->sendTime}}</td>
                    <td class=" ">{{$v->orderMoney}}</td>
                    <td class=" ">{{$v->payment}}</td>
                    <td class=" ">
                    	<form action="/admin/order/{{$v->id}}" method="post">
                    		<input type="hidden" name="_method" value="delete">
                    		{{csrf_field()}}
                    		<button class="btn btn-warning"><i class="icon-trash"></i>取消订单</button>
                    	</form>
                    </td>
                </tr>
                @endforeach
        </tbody></table>
        <div class="dataTables_paginate paging_full_numbers" id="DataTables_Table_1_paginate">
			<div id="pages">		
				{!! $orders->appends($data)->render() !!}
			</div>
		</div>
		</div>
    </div>
</div>
@endsection